# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Jobs.V4.Model.SearchJobsResponse do
  @moduledoc """
  Response for SearchJob method.

  ## Attributes

  *   `broadenedQueryJobsCount` (*type:* `integer()`, *default:* `nil`) - If query broadening is enabled, we may append additional results from the broadened query. This number indicates how many of the jobs returned in the jobs field are from the broadened query. These results are always at the end of the jobs list. In particular, a value of 0, or if the field isn't set, all the jobs in the jobs list are from the original (without broadening) query. If this field is non-zero, subsequent requests with offset after this result set should contain all broadened results.
  *   `histogramQueryResults` (*type:* `list(GoogleApi.Jobs.V4.Model.HistogramQueryResult.t)`, *default:* `nil`) - The histogram results that match with specified SearchJobsRequest.histogram_queries.
  *   `locationFilters` (*type:* `list(GoogleApi.Jobs.V4.Model.Location.t)`, *default:* `nil`) - The location filters that the service applied to the specified query. If any filters are lat-lng based, the Location.location_type is Location.LocationType.LOCATION_TYPE_UNSPECIFIED.
  *   `matchingJobs` (*type:* `list(GoogleApi.Jobs.V4.Model.MatchingJob.t)`, *default:* `nil`) - The Job entities that match the specified SearchJobsRequest.
  *   `metadata` (*type:* `GoogleApi.Jobs.V4.Model.ResponseMetadata.t`, *default:* `nil`) - Additional information for the API invocation, such as the request tracking id.
  *   `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The token that specifies the starting position of the next page of results. This field is empty if there are no more results.
  *   `spellCorrection` (*type:* `GoogleApi.Jobs.V4.Model.SpellingCorrection.t`, *default:* `nil`) - The spell checking result, and correction.
  *   `totalSize` (*type:* `integer()`, *default:* `nil`) - Number of jobs that match the specified query. Note: This size is precise only if the total is less than 100,000.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :broadenedQueryJobsCount => integer() | nil,
          :histogramQueryResults => list(GoogleApi.Jobs.V4.Model.HistogramQueryResult.t()) | nil,
          :locationFilters => list(GoogleApi.Jobs.V4.Model.Location.t()) | nil,
          :matchingJobs => list(GoogleApi.Jobs.V4.Model.MatchingJob.t()) | nil,
          :metadata => GoogleApi.Jobs.V4.Model.ResponseMetadata.t() | nil,
          :nextPageToken => String.t() | nil,
          :spellCorrection => GoogleApi.Jobs.V4.Model.SpellingCorrection.t() | nil,
          :totalSize => integer() | nil
        }

  field(:broadenedQueryJobsCount)
  field(:histogramQueryResults, as: GoogleApi.Jobs.V4.Model.HistogramQueryResult, type: :list)
  field(:locationFilters, as: GoogleApi.Jobs.V4.Model.Location, type: :list)
  field(:matchingJobs, as: GoogleApi.Jobs.V4.Model.MatchingJob, type: :list)
  field(:metadata, as: GoogleApi.Jobs.V4.Model.ResponseMetadata)
  field(:nextPageToken)
  field(:spellCorrection, as: GoogleApi.Jobs.V4.Model.SpellingCorrection)
  field(:totalSize)
end

defimpl Poison.Decoder, for: GoogleApi.Jobs.V4.Model.SearchJobsResponse do
  def decode(value, options) do
    GoogleApi.Jobs.V4.Model.SearchJobsResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Jobs.V4.Model.SearchJobsResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
